<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserBalanceFlowTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_balance_flow', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('user_id')->default('')->comment('用户ID');
            $table->tinyInteger('type')->default('0')->comment('0充值，1消费');
            $table->tinyInteger('from')->default('0')->nullable()->comment('充值渠道，0现金，1微信');
            $table->string('balance')->default('0')->comment('金额');
            $table->string('operator_id')->default('0')->comment('操作人 ID');
            $table->string('comment')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_balance_flow');
    }
}
